
import { Message } from 'element-ui';
import $https from '@/utils/https'
const getMessages = function () { }




const excute = (context: any, data: any) => {
  // data=>// {type:'mysql57',code:'showdatabases','sql':'SHOW DATABASES;'}
  $https.post('/excute', data).then((resp: any) => {
    console.log(resp)
    if (resp.data.code == 200) {
      // 执行sql
      context.commit(`excute_${data.code}`, resp.data.data)
    } else {
      console.log('excute acion 失败..')
    }
  })
}

export default {
  getMessages, excute
};
